<script setup lang="ts">

const option=ref<ECOption>({
  title: {
    text: '顺风车平台行程数量',
    subtext: '行程总数',
    left: 'center'
  },
  tooltip: {
    trigger: 'item'
  },
  legend: {
    orient: 'vertical',
    left: 'left'
  },
  series: [
    {
      name: '数量：（条目）',
      type: 'pie',
      radius: '50%',
      data: [
        { value: 0, name: '行程总数' },
      ],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]
})
onMounted(function (){
  cFetch<any>('/statistics/stroke',{
    auth:true,
    defaultOpts:{
      method:"GET",
    }
  }).then(res=>{
    if(res.code===200){
      change1(res.data.amount)
    }
  })
})
function change1(va:number){
  option.value.series[0].data[0].value=va
}

</script>

<template>
  <VChart :option="option"/>
</template>

<style scoped lang="scss">

</style>